import http from '@/utils/http';
import type { TCheckInReq } from './type';
import type { Dayjs } from 'dayjs';

export const getDailyDataByDate = (date: string | Dayjs) =>
  http.get<number>('/api/v1/feishu/checkTodayRoutine', { date });

export const checkIn = (params: TCheckInReq) =>
  http.post<any>('/api/v1/feishu/dailyRoutine', params);

export const getSheetAllData = () => http.get('/api/v1/feishu/getSheetAllData');

export const getOpenidList = (names: string) =>
  http.get<string[]>('/api/v1/user/getOpenidList', { names });

export const sendMsg = (openidList: string[]) =>
  http.post<string>('/api/v1/wechat/sendMsg', { openidList });
